import turtle as t
y = 10
太极半径 = R = 150
d = R/5

阴鱼 = 阳鱼 = r = R/2
鱼眼半径 = yang_circle_r = yin_circle_r = R/6
阴鱼眼圆心 = yin = (0,-2*R/3)
阳鱼眼圆心 = yang = (0,R/3)

八卦信息列表 = bagua = [	(1,1,0),#兑
						(0,0,0),#坤
						(1,0,1),#离
						(0,1,1),#巽
						(1,0,0),#震
						(0,0,1),#艮
						(0,1,0),#坎
						(1,1,1) #乾
					  ]

def 太极图():
	t.pu()
	t.goto(0,-R)
	t.pd()
	t.fillcolor('black')
	t.begin_fill()
	t.circle(R,-180)
	t.circle(r,-180)
	t.circle(-r,-180)
	t.end_fill()
	t.circle(-R,-180)
	t.pu()
	t.fillcolor('white')
	t.begin_fill()
	t.goto(0,R/3)
	t.circle(yang_circle_r)
	t.end_fill()
	t.pu()
	t.goto(0,-2*R/3)
	t.pd()
	t.fillcolor('black')
	t.begin_fill()
	t.circle(yin_circle_r)
	t.end_fill()
def huafang(aaa):
	t.fd(aaa)
	t.rt(90)
def yin():
	t.fd(4*y/3+y)
def yang():
	t.pu()
	t.fd(4*y/3+y)
	t.pd()
def huagua(g):
	t.fillcolor('black')
	t.begin_fill()	
	for i in (9*y/2,6*y,9*y,6*y,9*y/2):
		huafang(i)
	t.end_fill()
	t.fd(4*y/3+y/2)
	t.lt(90)
	t.pensize(y)
	t.pencolor('white')
	for i in (9*y/2+y,4*y/3+y,9*y+2*y,4*y/3+y,9*y/2+y):
		huafang(i)
#kaishifenyinyang	
	t.pu()
	t.bk(4*y/3+y)
	t.pd()
	if g[0] == 1:
		yang()
	else:
		yin()
	if g[1] == 1:
		yang()
	else:
		yin()
	if g[2] == 1:
		yang()
	else:
		yin()
太极图()
for i in range(8):
	t.pu()
	t.home()
	t.pensize(1)
	t.pencolor('black')
	t.pu()
	t.lt(0+i*45)
	t.fd(R+d)
	t.pd()
	t.lt(90)
	huagua(bagua[i])
t.done()